<template>
  <div>
    消息内容
    <ul>
      <li v-for="m in messages" :key="m.id">
<!--        在路径中添加的参数，会被加入了 route .query-->
<!--        <router-link  to="/student/messages/message?m=m">{{ m.title }}</router-link>-->
<!--     在路径传值时，写入字符串的方式 -->
<!--        <router-link  :to="`/student/messages/message?id=${m.id}&title=${m.title}`">{{ m.title }}</router-link>-->
        <router-link  :to="{
          path:'/student/messages/message',
          query:{
            m
          }
        }">{{ m.title }}</router-link>
      </li>
    </ul>
    <hr>
    <router-view></router-view>
  </div>
</template>

<script>
export default {
  name: "Messages",
  data() {
    return {
      messages: [
        {
          id: '001', title: "消息1"
        }, {id: '002', title: "消息2"}, {id: '003', title: "消息3"}
      ]
    }
  }
}
</script>

<style scoped>

</style>
